<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of generateHomogeneousStateRecursive</title>
  <meta name="keywords" content="generateHomogeneousStateRecursive">
  <meta name="description" content="This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">source</a> &gt; generateHomogeneousStateRecursive.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for source&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>generateHomogeneousStateRecursive
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [ hState ] = generateHomogeneousStateRecursive( m, x, varNumber, vect, threshold, hState ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.

This function in necessary for generateHomogeneousState to calculate the
homogeneous state vector.

Prototype: [hState] = generateHomogeneousStateRecursive(m, x, varNumber, vect, threshold, hState)

Input:     m - Dimension of the state vector x in homogeneous form.
           x - State vector
           varNumber - 
           vect - Vector that contains the degree of the #varNumber
                  variables to crate
           threshold - Number that decrease degree of next homogeneous
                       monomial variable to create
           hState - Homogeneous state vector

Output:    hState - Homogeneous state vector</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="generateHomogeneousStateRecursive.html" class="code" title="function [ hState ] = generateHomogeneousStateRecursive( m, x, varNumber, vect, threshold, hState )">generateHomogeneousStateRecursive</a>	This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="generateHomogeneousState.html" class="code" title="function [ hState ] = generateHomogeneousState( m, n )">generateHomogeneousState</a>	This function starts a recursive function that return the homogeneous state vector and return it.</li><li><a href="generateHomogeneousStateRecursive.html" class="code" title="function [ hState ] = generateHomogeneousStateRecursive( m, x, varNumber, vect, threshold, hState )">generateHomogeneousStateRecursive</a>	This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <span class="comment">%This function in necessary for generateHomogeneousState to calculate the homogeneous state vector.</span>
0002 <span class="comment">%</span>
0003 <span class="comment">%This function in necessary for generateHomogeneousState to calculate the</span>
0004 <span class="comment">%homogeneous state vector.</span>
0005 <span class="comment">%</span>
0006 <span class="comment">%Prototype: [hState] = generateHomogeneousStateRecursive(m, x, varNumber, vect, threshold, hState)</span>
0007 <span class="comment">%</span>
0008 <span class="comment">%Input:     m - Dimension of the state vector x in homogeneous form.</span>
0009 <span class="comment">%           x - State vector</span>
0010 <span class="comment">%           varNumber -</span>
0011 <span class="comment">%           vect - Vector that contains the degree of the #varNumber</span>
0012 <span class="comment">%                  variables to crate</span>
0013 <span class="comment">%           threshold - Number that decrease degree of next homogeneous</span>
0014 <span class="comment">%                       monomial variable to create</span>
0015 <span class="comment">%           hState - Homogeneous state vector</span>
0016 <span class="comment">%</span>
0017 <span class="comment">%Output:    hState - Homogeneous state vector</span>
0018 
0019 <a name="_sub0" href="#_subfunctions" class="code">function [ hState ] = generateHomogeneousStateRecursive( m, x, varNumber, vect, threshold, hState )</a>
0020 
0021 <span class="keyword">for</span> i = (m-threshold):-1:0
0022     vect(varNumber) = i;
0023     <span class="keyword">if</span> sum(vect) == m
0024         <span class="keyword">if</span> hState(1) == -1
0025             hState = prod(x.^vect);
0026         <span class="keyword">else</span>
0027             hState(length(hState)+1, 1) = prod(x.^vect);
0028         <span class="keyword">end</span>
0029     <span class="keyword">else</span>
0030         <span class="keyword">if</span> varNumber &lt; length(x)
0031             hState = <a href="generateHomogeneousStateRecursive.html" class="code" title="function [ hState ] = generateHomogeneousStateRecursive( m, x, varNumber, vect, threshold, hState )">generateHomogeneousStateRecursive</a>( m, x, varNumber+1, vect, threshold+i, hState );
0032         <span class="keyword">end</span>
0033     <span class="keyword">end</span>
0034 <span class="keyword">end</span>
0035 
0036 <span class="keyword">return</span>;
0037 
0038 <span class="keyword">end</span>
0039</pre></div>
<hr><address>Generated on Mon 12-Oct-2009 21:15:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>